The present invention relates to an arithmetic unit performing addition and subtraction, more particularly, an arithmetic unit that is appropriate for calculating data of arbitrary precision, which can exceeds any precisions that computer languages and the compilers can handle.
An arithmetic unit performing addition and subtraction in a processor has been supposed to deal with fixed-length integers. For example, an 8-bit fixed-length full adder for four-rule arithmetic operations and a 16-bit fixed-length full adder that can also be used for address generation have been used for 8-bit microprocessors.
Moreover, when variable-length data is declared in software descriptions, compilers generate a set of instructions to achieve the variable-length arithmetic calculations by iterating a set of the fixed-length full adder operations.
By such complier technique, calculation of the variable-length data could be performed even with the fixed-length full adder.
However, the precision (word length) of data and variables, with which a program can deal, is defined by programming languages and the compilers so that it has been quit difficult for software programs to deal with data of precision exceeding the definitions in the programming languages. Even though programming languages and the compilers cope with the difficulties in calculating variable-length data, extremely large digit number can be bounced out.
For example, hitherto-known computing devices cannot deal with 10,000-digit arithmetic calculations since the precision of the calculations is beyond the precision that the compilers can deal with. In order to achieve the calculations, the specific algorism has to be implemented in programs that handle a 10,000-digit number as a series of numbers, each of which can be handled by the compilers. Even though calculations with very-long-digit numbers can be done by such programming technique, the program shall be a bit complicated and too specific to the precision.
Even if a longer-word-length arithmetic unit, which is capable of calculating longer-fixed-length data at a time, was available, hardware would be quit large and complicated. Above all things, it comes to an essential problem that the calculation algorism specific to the word length had to be specifically implemented.